package WinterFlower.work0714;

import java.io.IOException;

/**
 * @author ZJM
 * @version 1.0
 * @since 2022-07-14 18:52:59
 */
public class UseRuntime {
    public static void main(String[] args) throws IOException {
        Runtime runtime = Runtime.getRuntime();

        System.out.println(runtime.availableProcessors());
        System.out.println(runtime.maxMemory()/1024/1024+"MB");
        System.out.println(runtime.totalMemory()/1024/1024+"MB");
        System.out.println(runtime.freeMemory()/1024/1024+"MB");

//        exec 执行 字符串形式的命令 得到一个进程

        runtime.exec("mspaint");
        runtime.exec("calc");
        runtime.exec("mstsc");//远程

//        logoff 注销  stutdown -s -t 100  shutdown 100s

        runtime.exec("D:\\Soft/QQ/Bin/");

    }
}
